The present invention relates to a sequence abnormality check system in a programmable controller so as to check a cause of failure when abnormality occurs in processing results of the programmable controller.
In a conventional sequence control system, a sequence circuit is arranged between a control device and a machine to be controlled. The sequence circuit comprises a heavy current circuit consisting of a number of relays. A predetermined relay is operated in response to an instruction from the control device so as to cause machine members to perform a predetermined operation in accordance with this instruction. In a system using a programmable controller (to be referred to as a PC hereinafter), information for the sequence circuit is stored in the form of a program in a memory of the PC, thereby performing sequence control.
For example, the sequence circuit is exemplified by a ladder diagram represented by relay symbols, as shown in FIG. 1. A sequence program having a logical sequence of instruction codes and operands shown in FIG. 2 is stored in a memory of the PC, thereby achieving proper sequence control.
The ladder diagram shown in FIG. 1 comprises part of a ladder diagram of a numerical control (NC) machine tool system. Symbols and denote normally open and closed contacts of relays (not shown) each having a reference symbol. When M03 (spindle forward rotation instruction) is supplied from an NC in the automatic mode, relays MF, M12 and M11 are operated to energize a relay M03X. In this case, since the automatic mode is set, a relay AUT is kept ON. Unless the spindle is rotated in the reverse direction, (a relay SPCCW is kept OFF) and a relay SPCW is turned on. This indicates that the spindle forward rotation instruction is supplied to a machine such as a machine tool. In the conventional system, the high current circuit having the relays represented by the ladder diagram controls the sequence of the machine tool.
The PC creates a sequence program of FIG. 2 in accordance with the latter diagram, and the sequence program is stored in a memory so as to provide sequence control including instruction codes such as "RD", "AND", "WRT", "OR", "AND.multidot.NOT", etc. More specifically, RD is a read instruction; AND is a logical product operation instuction; WRT is a write instruction; OR is a logical sum operation instruction; and AND.multidot.NOT is an inversion/logical product instruction. Numeric values in the operand column represent addresses of a data memory (to be described later) incorporated in the PC. The addresses correspond to relay symbols (MF, M28, etc.) of FIG. 1, respectively. The relationship between the relay symbol and the address is illustrated in FIG. 1.
The relay symbols are listed for reference at the right of the table in FIG. 2. The information at the addresses of the data memory which are described in the column of operands is calculated by an instruction group D1 of the sequence program. In other words, a logical operation MF.multidot.M28.multidot.M24.multidot.M22.multidot.M21.multidot.M18.multid ot.M14.multidot.M12.multidot.M11 is calculated. A calculation result ("1" or "0") is stored at address 10.2 of the data memory which corresponds to the relay M03X. The following operation is performed in accordance with an instruction group D2:
AUT.multidot.M03X.multidot.SPCCW
A calculation result is stored at address 20.5 of the data memory which is designated by the operand SPCW. As a result, a spindle forward rotation signal is supplied to the machine tool as an external machine, so that the spindle of the machine tool is rotated in the forward direction. In this manner, the sequence control system having the PC is operated in accordance with the sequence program. In this control system, when an intermittent failure of the sequence occurs during automatic operation of the machine tool, it is difficult to determine the cause.
Assume that the machine tool is interrupted while in a feed hold state during NC automatic operation, and that the machine tool is not supposed to be stopped. A feed hold circuit is illustrated in FIG. 3A. Reference symbol a denotes a feed hold button; reference symbol b indicates a pressure decrease detection switch; and reference symbol SP denotes a feed hold relay. This feed hold circuit is represented by a ladder diagram in FIG. 3B. Since the machine tool is interrupted in the feed hold state, the feed hold relay SP is stopped. When a signal (i.e., logic level of the signal at address 102.5 of the data memory which represents the feed hold relay SP) representing the operating state of the feed hold relay SP is checked, a "1" is stored at address 102.5. The logic level "1" indicates that the feed hold relay SP is normally operated. This indicates that the failure may have been caused by the contact of the feed hold button or the pressure decrease detection switch being accidentally and temporarily opened during automatic operation.
However, since the contacts a and b are only instantaneously turned off, it is difficult to check changes in levels of the contacts although the contacts a and b are monitored. For this reason, detection cannot be performed as to which contact system caused the abnormality. In this sense, the failure check operation becomes cumbersome. In order to solve this problem, a system can be proposed wherein a failure check program is created and stored in the PC to discriminate failures. Even with this system, failure check operation is cumbersome.